<?php

namespace app\models;

use Yii;

/**
 * This is the model class for table "car_user".
 *
 * @property integer $id
 * @property string $username
 * @property string $password
 * @property string $tel
 * @property string $email
 */
class CarUser extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'car_user';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['username', 'password', 'tel', 'email'], 'required'],
            [['username', 'password', 'tel', 'email'], 'string', 'max' => 255],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'username' => 'Username',
            'password' => 'Password',
            'tel' => 'Tel',
            'email' => 'Email',
        ];
    }

     public function fields()
    {
    $fields = parent::fields();

    // 删除一些包含敏感信息的字段
    unset($fields['password']);

    return $fields;
    }
}
